(function () {
    var EVENT_CLICK = Laya.Event.CLICK;
    var io = ppt.io;

    function shopTab(call) {
        shopTab.super(this);
        this.callback  = call;
        this.init();
    }
    Laya.class(shopTab, "Com.Shop.Tab", ui.Shop.ShopTabUI);
    var _proto = shopTab.prototype;

    _proto.init = function () {
        //io.register("shop::shopInfo", this, this.changeData);
        this.on(Laya.Event.CLICK,this,this.shopTab);
         
    }
    //商品切换
    _proto.shopTab = function () {
        //this.index = this.selectedIndex;
        var selectedIndex = this.shoptab.selectedIndex;
            for(var i = 0 ; i < 3 ; i ++){
                if(i == selectedIndex){
                    this.getChildByName("shop"+(selectedIndex+1)).index = 0;
                }else{
                    this.getChildByName("shop"+(i+1)).index = 1;
                }
                
            }
            io.emit({'cmd' : 'shop::shopInfo', params : {'currency':(selectedIndex+1)}});
           // this._selectindex = [];

           this.callback(selectedIndex);
    }
    
})();